#include<stdio.h>
//得到a的n次方
int fac(int a, int n) {
	int product = 1;
	for (int i = 0; i < n; i++) {
		product *= a;
	}
	return product;
}
//打印n个a(本题为1或0)
void print(int a, int n) {
	for (int i = 0; i < n; i++) {
		printf("%d", a);
	}
}
//得到权重最大的1所在对应的位次对应的2的几次
int judge_digit(int a, int n) {
	if (a == 0 || a == 1) {
		return 0;
	}
	if (fac(2, n - 1) <= a && a < fac(2, n)) {
		return n - 1;
	} else {
		return judge_digit( a, n - 1);
	}
}
//核心函数
void opt_print(int a, int n) {
	if (n == 0) {
		if (a == 1) {
			printf("1");
		}
		if (a == 0) {
			printf("0");
		}
	} else {
		if (a >= fac(2, n)) {
			printf("1");
			return opt_print(a - fac(2, n), n - 1);
		}// else if (a == fac( 2, n )) {
		//printf("1");
		//	print( 0, n );
		//}
		else {
			printf("0");
			return opt_print( a, n - 1);
		}
	}
}
int main() {
	int a = 0;
	scanf("%d", &a);
	int n = judge_digit( a, 8 );
	print( 0, 7 - n);
	opt_print( a, n);
	return 0;
}
